<?php
//echo "list clinet";
//print_r($listreminder);
$arr_status=array();
foreach ($liststatus as $ls)
{
	$arr_status[$ls['idstatus']]=$ls['desc'];
	
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/960_24_col.css" />
 <link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" />
 <link rel="stylesheet" href="css/style.css" />
 <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
 <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<style>
.principal .reminder table thead th {
      font-size: 9px;
   
}
.principal .reminder table tbody td  {
      font-size: 10px;
   
}
</style>
</head>

<body>
	<div class="principal container_24 listclient">
		
		<!--logo-->
		<div class="logo grid_24">
			<div class="grid_1">&nbsp;</div>
			<div class="grid_4 logoimage">LOGO</div>
			<div class="logout grid_5"><a href="index.php?loginprocess/loginout"><img src="img/bt_logout.jpg"/></a></div>
		</div><!-- end logo-->
		
		<!--menupricipal-->
		<div class="menuprincipal grid_24">
			<a  style="color" href="index.php?gclient/bookinglistuser" >Allez  à la List des Booking</a> &nbsp;&nbsp;&nbsp;<?php if ($role=="admin"){?><a  style="color" href="index.php?gadmin/bookinglistadmin" >Retournez à l'ADMIN</a><?php }?>
		</div>
		<!-- end menupricipal-->
			<div class="grid_18 datagrid reminder"  style="margin-right:30px;float:right; margin-top: 10px;">
				<h5>Reminder Long Time This week</h5>
				<table>
				
				<thead><tr><th>NOM<BR/>COMPAGNIE</th><th>ADRESSE</th><th>TELEPHONE</th><th>VILLE</th><th>STATUS</th><th>COMMENTAIRE</th><th>SUIVI<BR>LONG TERM</th><th>OPTION</th></tr></thead>
				<tbody>
				
				<?php 
				$color=1;
				foreach ($listreminder as $lc){ 
				?>
				<tr class="<?php if($color%2==0) echo "paire"; else echo "impaire";?>">
				<td><?php echo $lc["companyname"]?><br/>
							
				</td>
				<td><?php echo $lc["address"]?>$</td><td><?php echo $lc["tele"]?></td><td><?php echo $lc["city"]?></td>
				<td><?php echo $lc["desc"]?><br/>
				<form action="index.php?gclient/editclientstatus" method="post">
					<input type="hidden" name="idcase" value="<?php echo $lc["idcase"];?>"/>
					<input type="submit" name="changer" value="Changer"/>
				</form>
				</td><td><?php echo $lc["reminder"]; ?></td><td><?php echo $lc["longtimefollowups"]?><br/><span style="color:red;"><i><?php if($lc["reminderlongtime"]!=""){echo "alert: ".$lc["reminderlongtime"];}?></i></span></td>
				<td>
					<form action="index.php?gclient/editclient" method="post">
						<input type="hidden" name="idclients" value="<?php echo $lc["idclients"];?>"/>
						<input type="submit" name="delete" value="detail">
					</form>
				</td></tr>
						
				<?php
				 	$color++;
					}
				 ?>
				</tbody>
			</table></div>	
			<!--  <div class="descprincipal grid_22 ">
			
			</div>-->
			
			<div class="grid_24 listcontent detail">
				<h1>List des clients <?php if(isset($idstatus)){?> <span style="color:red;font-size:16px"> Par Filtre de Status (<?php echo $arr_status[$idstatus]; ?>) <?php }?></h1>
				
				<div class="grid_24 top">
				<div>
				<h5>Filtre by status</h5>
				<a href="index.php?gclient/listclient" >Clear le filtre</a>
				<form action="index.php?gclient/filtrebystatus" method="post">
				<select name="idstatus" >
				<?php foreach ($liststatus as $ls){?>
					<option value="<?php echo $ls["idstatus"];?>" <?php if (isset($idstatus)&&$ls["idstatus"]==$idstatus){?>selected<?php } ?>><?php echo $ls["desc"]; ?></option>
				<?php } ?>
				</select>
				<input type="submit" value="submit">
				</form>
				</div>
				
				</div>
			
					
			<div class="grid_24 detaillist datagrid">
				<table>
				
				<thead><tr><th>NOM<BR/>COMPAGNIE</th><th>ADRESSE</th><th>TELEPHONE</th><th>FAX</th><th><BR/>VILLE</th><th>NOM DE<BR>CONTACT</th><th>EMAIL</th><th>STATUS</th><th>COMMENTAIRE</th><th>SUIVI<BR>LONG TERM</th><th>OPTION</th></tr></thead>
				<tbody>
				
				<?php 
				$color=1;
				foreach ($listclient as $lc){ 
				?>
				<tr class="<?php if($color%2==0) echo "paire"; else echo "impaire";?>">
				<td><?php echo $lc["companyname"]?><br/>
					
					<form action="index.php?gclient/bookingshowform" method="post">
					<input type="hidden" name="idcase" value="<?php echo $lc["idcase"];?>"/>
					<input type="submit" name="booking" value="Booking"/>
				</form>
				
				</td>
				<td><?php echo $lc["address"]?>$</td><td><?php echo $lc["tele"]?></td><td><?php echo $lc["fax"]?></td><td><?php echo $lc["city"]?></td><td><?php echo $lc["contactperson"]?></td>
				<td><?php echo $lc["contactpersonemail"]?></td><td><?php echo $lc["desc"]?><br/>
				<form action="index.php?gclient/editclientstatus" method="post">
					<input type="hidden" name="idcase" value="<?php echo $lc["idcase"];?>"/>
					<input type="submit" name="changer" value="Changer"/>
				</form>
				</td><td><?php echo $lc["reminder"]; ?></td><td><?php echo $lc["longtimefollowups"]?><br/><span style="color:red;"><i><?php if($lc["reminderlongtime"]!=""){echo "alert: ".$lc["reminderlongtime"];}?></i></span></td>
				<td>
					<form action="index.php?gclient/editclient" method="post">
						<input type="hidden" name="idclients" value="<?php echo $lc["idclients"];?>"/>
						<input type="submit" name="delete" value="Edit">
					</form>
					<form  action="" method="post">
					<input type="hidden" name="idclients" value="<?php echo $lc["idclients"];?>"/>
					<input type="submit" name="edit" value="Delete"/>
					</form>
				</td></tr>
						
				<?php
				 	$color++;
					}
				 ?>
				</tbody>
			</table></div>
			<form action="index.php?gclient/clientform" method="post">
				<input type="submit" name="addnewclient" value="Add new Client">
			</form>
		</div>
	</div><!--end principal-->
</body>
</html>